package edu.isistan.matching.structures.elements;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class MessageElement extends WSDLElement {

	public static final String IN_MESSAGE = "inMessage";
	public static final String OUT_MESSAGE = "outMessage";

	public static String FAULT_MESSAGE = "outMessage";

	private String typeMessage = "";

	List<PartElement> partsList = new ArrayList<PartElement>();

	public MessageElement(String nombre) {
		super(nombre);
	}

	public List<PartElement> getPartsList() {
		return partsList;
	}

	public void setPartsList(List<PartElement> partsList) {
		this.partsList = partsList;
		for (Iterator<PartElement> iterator = partsList.iterator(); iterator.hasNext();) {
			PartElement part = iterator.next();
			part.setParentElement(this);
		}
	}

	public String toString() {
		return "(mensaje " + getName() + ": parts:" + getPartsList() + ")";
	}

	public String getTypeMessage() {
		return typeMessage;
	}

	public void setTypeMessage(String typeMessage) {
		this.typeMessage = typeMessage;
	}
}
